﻿using ConfExpert.Forms.Base;
using DevTeam;
using System;
using System.Windows.Forms;

namespace ConfExpert.Forms.Depo._7C
{
    public partial class Reference : XForm
    {
        public Reference()
        {
            InitializeComponent();
            TAM.GPrefTableAdapter = new Datasets.MyDataTableAdapters.GPrefTableAdapter();
        }

        BindingSource bs;
        private void Reference_Load(object sender, EventArgs e)
        {            
            bs = new BindingSource(ds, "GPref");
            AddBsToList(bs);
            InitGridView(gridView1, bs);
            //GetDetails("GPref", "GetHelper", "GPref", Session.CKBatchId);
            TAM.GPrefTableAdapter.Fill(ds.GPref);
            gridView1.AddSummary();
            gridView1.OptionsView.NewItemRowPosition = DevExpress.XtraGrid.Views.Grid.NewItemRowPosition.Bottom;

            btnKaydet.Visibility = !ytk(56) ? DevExpress.XtraBars.BarItemVisibility.Always : DevExpress.XtraBars.BarItemVisibility.Never;
            btnKaydet.ItemClick += btnKaydet_ItemClick;
            gridView1.BestFitColumns();
        }

        void btnKaydet_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            Save();
        }
    }
}